<?php
class Entity {
/**
	 * Dynamic getters and setters than maintain getX and setX formati. They can be overwritten
	 * if custom processing is needed
	 *
	 * @param string $method
	 * @param array $arguments
	 * @return mixed
	 */
	
	function __call($method, $arguments) {

		#Is this a get or a set
		$prefix = strtolower(substr($method, 0, 3));

		#What is the get/set class attribute
		$property = substr($method, 3);

		if (empty($prefix) || empty($property)) { #Did not match a get/set call
			throw New Exception("Calling a non get/set method that does not exist: $method");
		}

		#Check if the get/set paramter exists within this class as an attribute
		$match=false;
		foreach($this as $class_var=>$class_var_value){
			if(strtolower($class_var) == strtolower($property)){
				$property=$class_var;
				$match=true;
			}
		}

		#Get attribute
		if ($match && $prefix == "get" && (isset($this->$property) || is_null($this->$property))) {
			return $this->$property;
		}

		#Set
		if ($match && $prefix == "set") {
			$this->$property = $arguments[0];
		}
		elseif (!$match && $prefix == "set"){
			throw new Exception("Setting a variable that does not exist: var:$property value: $arguments[0]");
		}
		else{
			throw new Exception("Calling a get/set method that does not exist: $property");
		}
	}
	
}

class UrlCraw extends Entity {
	
	protected $id;
	
	protected $sitemap;
	
	protected $userBlog;
	
	protected $blog;
	
	protected $reglink;
	
	protected $type;
	
	protected $domain;
	
	protected $tag;
	
	protected $linkSelecterJs;
	
	protected $activeLinkJs;
	
	protected $linkSelecter;
	
	protected $titleSelecter;
	
	protected $contentSelecter;
	
	protected $removeSelecter;
	
	protected $customSelecter;
	
	protected $category;
	
	protected $typelink;
	
	protected $source;
	
	protected $sourcetype;
	
	protected $source_image;
	
	protected $remove_tag_a;
	
	protected $activeContentJs;
	
	protected $md5;
	
	protected $timeCraw;
	
	protected $error;
	
	protected $typeError;
	
	protected $timeError;
	
	protected $time;
	
	protected $active;
	
	protected $field;
	
	protected $order;
	
	protected $share;
	
	protected $craw;
	
	protected $getAll;
	
	protected $arrLink;
}